-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for macos in apple_*_xcframework
rules
#2459
base: master
Are you sure you want to change the base?
Conversation
"macos": attr.string_list( | ||
doc = """ | ||
A list of strings indicating which architecture should be built for the macOS platform (for example, `x86_64`, `arm64`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this a string_list_dict
keeps the logic simpler, and maybe we just fail if folks pass simulator
?
d8a3282
to
83af71b
Compare
apple_*_xcframework
rules
df2c4f8
to
a330f7f
Compare
if split_deps_key in deps: | ||
all_deps += deps[split_deps_key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keith @brentleyjones this fixes an issue introduced by adding the macos
attr to apple_static_xcframework
:
ERROR: /Users/lpadron/Development/rules_apple/test/starlark_tests/targets_under_test/apple/BUILD:942:25: in apple_static_xcframework rule //test/starlark_tests/targets_under_test/apple:ios_static_xcframework_with_resources:
Traceback (most recent call last):
File "/Users/lpadron/Development/rules_apple/apple/internal/xcframework_rules.bzl", line 943, column 83, in _apple_static_xcframework_impl
link_outputs_by_library_identifier = _group_link_outputs_by_library_identifier(
File "/Users/lpadron/Development/rules_apple/apple/internal/xcframework_rules.bzl", line 205, column 45, in _group_link_outputs_by_library_identifier
if swift_support.uses_swift(deps[split_attr_key]):
Error: key "ios_arm64e_device" not found in dictionary
How should we properly fix this? Is the apple_rule_arm64_as_arm64e_transition
being applied here for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still leaves us with:
ERROR: /Users/lpadron/Development/rules_apple/test/starlark_tests/targets_under_test/apple/BUILD:508:8: declared output 'test/starlark_tests/targets_under_test/apple/ios_xcframework_bundling_static_fmwks.xcframework/ios-arm64_x86_64-simulator/ios_xcframework_bundling_static_fmwks.framework/Headers/ios_xcframework_bundling_static_fmwks.h' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT adding macos
changes the transitions to add arm64e
, maybe this is related to #2419 as well since that's a split deps issue as well.
a330f7f
to
113bdd4
Compare
Fixes #1475. Adds a new
macos
attr to theapple_*_framework
rules which allow setting the architectures to build a macOS binary for.